/**
 * 
 */
package br.embedded.socialapp.business;

import org.opensocial.Client;
import org.opensocial.auth.AuthScheme;
import org.opensocial.auth.OAuth2LeggedScheme;
import org.opensocial.providers.OrkutSandboxProvider;
import org.opensocial.providers.Provider;

/**
 * @author Daniel
 *
 */
public class OrkutClientFactory
{
	private static final String CONSUMER_KEY = "orkut.com:1049353326065";
	private static final String CONSUMER_SECRET = "LU9ryU+f+lv/Yzmyiyz/Kmzc";
	private static final String VIEWER_ID = "16402456860419996289";
	
	private static Provider provider;
	private static AuthScheme authScheme;
	private static OrkutClientFactory singleton;
	private static Client client;
	
	private OrkutClientFactory()
	{
		provider = new OrkutSandboxProvider(); 
		authScheme = new OAuth2LeggedScheme(CONSUMER_KEY, CONSUMER_SECRET, VIEWER_ID);
		client = new Client(provider, authScheme);
	}
	
	public static OrkutClientFactory getInstance()
	{
		if (singleton == null)
			singleton = new OrkutClientFactory();
		return singleton;
	}
	
	public Client getClient()
	{
		return client;
	}
}
